#include <iostream>
using namespace std;
void Quicksort(int arr[],int L,int R)
{
	if (L >= R)
	{
		return;
	}
	int left = L;
	int right = R;
	int pivot = arr[left];
	while (left < right)
	{
		while (left < right && arr[right] >= pivot)
		{
			right--;
		}
		if (left < right)
		{
			arr[left] = arr[right];
		}
		while (left < right && arr[left] <= pivot)
		{
			left++;
		}
		if (left < right)
		{
			arr[right] = arr[left];
		}
		if (left >= right)
		{
			arr[right] = pivot;
		}
	}
	Quicksort(arr, L, right - 1);
	Quicksort(arr, right + 1, R);
}
int main()
{
	int arr[] = { 5 ,24 ,37 ,46 ,74 ,77 ,63 ,48 ,55 ,12 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Quicksort(arr, 0, sz-1);
	for (int i = 0; i < sz; i++)
	{
		cout << arr[i] << "  ";
	}
}